package com.jams.goodox.entity.resp;

import com.jams.goodox.entity.Mapper;
import com.jams.goodox.entity.MeetRoomIntroduceBean;
import com.jams.goodox.entity.PageInfo;
import com.jams.goodox.net.BaseEntity;
import com.jams.goodox.utils.Utils;

import java.util.ArrayList;
import java.util.List;

/**
 * 场地预定实体
 * Created by jams_zhen on 2017/6/2.
 */

public class MeetRoomListResp extends BaseEntity{

    private DataBean data;

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public static class DataBean implements Mapper<List<MeetRoomIntroduceBean>>{
        private PageInfo pageInfo;
        private List<ResultListBean> resultList;

        public PageInfo getPageInfo() {
            return pageInfo;
        }

        public void setPageInfo(PageInfo pageInfo) {
            this.pageInfo = pageInfo;
        }

        public List<ResultListBean> getResultList() {
            return resultList;
        }

        public void setResultList(List<ResultListBean> resultList) {
            this.resultList = resultList;
        }

        @Override
        public List<MeetRoomIntroduceBean> transform() {
            List<MeetRoomIntroduceBean> list=new ArrayList<>();
            if(resultList!=null&&resultList.size()>0){
                for(ResultListBean resultListBean:resultList){
                    list.add(resultListBean.transform());
                }
            }
            return list;
        }

        public static class ResultListBean implements Mapper<MeetRoomIntroduceBean>{
            private String address;
            private String equip;//设备:,分割
            private String price;//价格
            private String count;//人数
            private String placeTypeId;//场地类型id
            private int pay_type;//2,免费 1,收费
            private String id;//场地id
            private List<MeetRoomIntroduceBean.EmptyMeetDateBean> dateList;//近期空余场次
            private List<String> picList;//图片列表
            private String serverContent;//服务内容

            public String getAddress() {
                return address;
            }

            public void setAddress(String address) {
                this.address = address;
            }

            public String getEquip() {
                return equip;
            }

            public void setEquip(String equip) {
                this.equip = equip;
            }

            public String getPrice() {
                return price==null?"":price;
            }

            public void setPrice(String price) {
                this.price = price;
            }

            public String getPlaceTypeId() {
                return placeTypeId;
            }

            public void setPlaceTypeId(String placeTypeId) {
                this.placeTypeId = placeTypeId;
            }

            public int getPay_type() {
                return pay_type;
            }

            public void setPay_type(int pay_type) {
                this.pay_type = pay_type;
            }

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public List<String> getPicList() {
                return picList;
            }

            public void setPicList(List<String> picList) {
                this.picList = picList;
            }

            public String getServerContent() {
                return serverContent;
            }

            public void setServerContent(String serverContent) {
                this.serverContent = serverContent;
            }

            public List<MeetRoomIntroduceBean.EmptyMeetDateBean> getDateList() {
                return dateList;
            }

            public void setDateList(List<MeetRoomIntroduceBean.EmptyMeetDateBean> dateList) {
                this.dateList = dateList;
            }

            @Override
            public MeetRoomIntroduceBean transform() {
                MeetRoomIntroduceBean meetRoomIntroduceBean=new MeetRoomIntroduceBean();
                meetRoomIntroduceBean.setEmptyMeetDateBeen(dateList==null?new ArrayList<MeetRoomIntroduceBean.EmptyMeetDateBean>():dateList);
                meetRoomIntroduceBean.setCanInPeople(String.format("容纳人数：%s人",count));
                meetRoomIntroduceBean.setRoomPrice(pay_type==2?"免费":String.format("%s元/小时",price));
                meetRoomIntroduceBean.setRoomName(address);
                meetRoomIntroduceBean.setRoomMatings(Utils.getListByString(equip,","));
                meetRoomIntroduceBean.setId(id);
                meetRoomIntroduceBean.setMeetServiceList(Utils.getListByString(serverContent,","));
                meetRoomIntroduceBean.setPicList(picList==null?new ArrayList<String>():picList);
                return meetRoomIntroduceBean;
            }

        }
    }
}
